import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_menu/biz/order/order_controller.dart';
import 'package:flutter_menu/res/app_color.dart';
import 'package:flutter_menu/utils/widget_help.dart';
import 'package:flutter_menu/widgets/load_container.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get_state_manager/src/simple/get_state.dart';
import 'package:get/get_state_manager/src/simple/get_view.dart';

// 搜索页面， 点击详情去大图页面
@Deprecated("废弃， 使用SearchPg")
class SearchPage extends GetView<OrderController> {
  const SearchPage({super.key});

  @override
  Widget build(BuildContext context) {
    TextEditingController? _controller;
    return GetBuilder<OrderController>(
        init: controller,
        initState: (_) {
          _controller = TextEditingController();
        },
        dispose: (_) {
          _controller?.dispose();
        },
        builder: (controller) {
          return Container(
            color: Colors.white,
            child: Column(
              children: [
                Container(
                  height: 80.h,
                  alignment: Alignment.center,
                  padding: EdgeInsets.symmetric(horizontal: 16.w),
                  decoration: BoxDecoration(
                    border: Border.all(
                      color: AppColors.bgTab,
                      width: 2.h,
                    ),
                  ),
                  child: Row(
                    children: [
                      TextField(
                        controller: _controller,
                        maxLength: 64,
                        textAlign: TextAlign.start,
                        decoration: const InputDecoration(
                          border: InputBorder.none,
                          counterText: '',
                        ),
                        onChanged: (value) {},
                        style: const TextStyle(
                          fontSize: 20.0,
                        ),
                      ).expanded(),
                      ElevatedButton(
                        onPressed: () {
                          // 按钮点击事件
                          debugPrint('Button tapped!');
                        },
                        style: ElevatedButton.styleFrom(
                            shadowColor: Colors.black.withOpacity(0.35),
                            elevation: 0,
                            backgroundColor: AppColors.buttonBgInBottomSheet,
                            shape: RoundedRectangleBorder(
                                borderRadius: BorderRadius.circular(10.w))),
                        child: Text('Button',
                            style: TextStyle(
                                height: 1.2,
                                color: AppColors.textInBottomSheet,
                                fontSize: 28.sp)),
                      ).size(width: 134.w, height: 68.h)
                    ],
                  ),
                ),
              ],
            ),
          );
        });
  }
}
